<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- 一定要写value值，否则会显示为null -->
        <input type="checkbox" v-model="checkArray" value="vue">vue
        <input type="checkbox" v-model="checkArray" value="react">react
        <input type="checkbox" v-model="checkArray" value="node">node
        <input type="checkbox" v-model="checkArray" value="js">js
        <!-- name="lang",name同一属性来约束单选 -->
        <input type="radio" v-model="checkLang" value="vue" name="lang">vue
        <input type="radio" v-model="checkLang" value="js" name="lang">js
        <button @click="login()">提交</button>
        <button @click="handleLang()">radio提交</button>
    </div>

</body>
<script>
    var vm = new Vue({
        el: "#app",
        data: {
            checkArray: [],
            checkLang: "vue"
        },
        methods: {
            login() {
                console.log(this.checkArray);

            },
            handleLang() {
                console.log(this.checkLang);
            }
        }
    })
</script>

</html>